{
    "metadata": {
        "kernelspec": {
            "name": "SQL",
            "display_name": "SQL",
            "language": "sql"
        },
        "language_info": {
            "name": "sql",
            "version": ""
        }
    },
    "nbformat_minor": 2,
    "nbformat": 4,
    "cells": [
        {
            "cell_type": "markdown",
            "source": "Connect to SQL Server and then run this T-SQL to enable external script execution:",
            "metadata": {}
        },
        {
            "cell_type": "code",
            "source": "EXEC sp_configure  'external scripts enabled', 1\r\nRECONFIGURE WITH OVERRIDE",
            "metadata": {},
            "outputs": [],
            "execution_count": 0
        },
        {
            "cell_type": "markdown",
            "source": "Verify ML Services is working by running the following simple R/Python sp_execute_external_scripts:",
            "metadata": {}
        },
        {
            "cell_type": "code",
            "source": "EXECUTE sp_execute_external_script \r\n@language = N'R',\r\n@script = N'\r\nprint(\"Hello World!\")\r\nprint(R.version)\r\nprint(Revo.version)\r\nOutputDataSet <- InputDataSet', \r\n@input_data_1 = N'select 1'\r\nGO",
            "metadata": {},
            "outputs": [],
            "execution_count": 0
        },
        {
            "cell_type": "code",
            "source": "EXECUTE sp_execute_external_script \r\n@language = N'Python',\r\n@script = N'\r\nimport sys\r\nprint(sys.version)\r\nprint(\"Hello World!\")\r\nOutputDataSet = InputDataSet',\r\n@input_data_1 = N'select 1'\r\nGO",
            "metadata": {},
            "outputs": [],
            "execution_count": 0
        }
    ]
}